package com.ca.demo.common.base;

import com.ca.demo.common.page.PageRequest;
import com.github.pagehelper.PageInfo;

import java.io.Serializable;
import java.util.List;

/**
 * @Author XieLei
 * @Date 2017/6/22 14:12
 */
public interface BaseService<T extends BaseEntity<ID>, ID extends Serializable> {

    T findOne(ID id);

    T save(T entity);

    T update(T entity);

    List<T> batchSave(List<T> entities);

    List<T> findAll();

    PageInfo<T> findByPage(T example, PageRequest pageRequest);

}
